﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace BlogWeb.Models
{
    public class AdLogin
    {
        [DisplayName("用户名")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "*")]
        [RegularExpression(@"[a-zA-Z0-9_]{3,16}", ErrorMessage = "用户名是3至16位字母_组成")]
        public string Acc { get; set; }
        [DisplayName("密码")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "*")]
        [RegularExpression(@"^[a-zA-Z0-9]{6,}$", ErrorMessage = "至少6位字母加数字密码")]
        public string Pwd { get; set; }
        [DisplayName("验证码")]
        [Required(AllowEmptyStrings = false, ErrorMessage = "*")]
        [RegularExpression(@"^\d{4}$", ErrorMessage = "4位验证码")]
        public string ChkCode { get; set; }
    }
}